package com.joyoung.datarespository;

import org.json.JSONObject;

/**
 * Created by Administrator on 2017\8\4 0004.
 */

public class LoginBuilder {

    private JSONObject jsonObject = new JSONObject();


    public LoginBuilder uname(String uname) throws Exception {
        jsonObject.put("uname", uname);
        return this;
    }

    public LoginBuilder passwd(String passwd) throws Exception {
        jsonObject.put("passwd", passwd);
        return this;
    }

    public LoginBuilder dcode(String dcode) throws Exception {
        jsonObject.put("dcode", dcode);
        return this;
    }

    public LoginBuilder mobilenum(String mobilenum) throws Exception {
        jsonObject.put("mobilenum", mobilenum);
        return this;
    }

    public LoginBuilder vcode(String vcode) throws Exception {
        jsonObject.put("vcode", vcode);
        return this;
    }

    public LoginBuilder ischange(String ischange) throws Exception {
        jsonObject.put("ischange", ischange);
        return this;
    }

    public LoginBuilder page(int start, int limit) throws Exception {
        JSONObject page = new JSONObject();
        page.put("start", start);
        page.put("limit", limit);
        jsonObject.put("page", page);
        return this;
    }


    public String build() throws Exception {
        return jsonObject.toString();
    }
}
